
// f(1) = 1;
// f(2) = 2;
// f(3) = f(1) + f(2)
// ...
// f(n) = f(n-1) + f(n-2)

export function getStepCount(n: number) {
    if (Number.isNaN(n)) return;
    if (n <= 0) return;

    if (n <= 2) return n;

    let n1 = 1;
    let n2 = 2;
    let i = 3;
    let step = 0;
    while(i <= n) {
        step = n1 + n2;
        n1 = n2;
        n2 = step
        i++;
    }

    return step;
}